package com.zte.claa.inficombo.csa.app.service.modbus;

import com.serotonin.modbus4j.ModbusMaster;
import com.zte.claa.inficombo.csa.app.service.modbus.entity.ModbusRequestConfig;

public interface ModbusMasterService {
	
	public void init() throws Exception;
	
	public void destory() throws Exception;
	
	//获取主站对象
	public ModbusMaster getModbusMaster() throws Exception;
	
	//连接modbus slave
	public void connectToModbusSlave() throws Exception;	
	
	//判断是否连接成功
	public boolean hasConnectToModbusSlave() throws Exception;
	
	//断开连接
	public void closeConnectToModbusSlave() throws Exception;
		
	//读保持寄存器
	public byte[] readHoldingRegister(int slaveId, int offset, int num) throws Exception;	
	
	public void dealwapperReadHoldingRegister(ModbusRequestConfig config) throws Exception;
}
